Feat/pgo v3#1138
Conversation
|
StaticPHP Test Bot Detected: Extensions: |
|
(I tested with static-php/packages v3 branch, php 8.5 zig on rpm. Tests with Alpine and gcc are still to finish in a few hours when ci runs.) |
|
Wair, why is curl a target like php and not a package/library? We don't compile the exe right? |
We could compile curl.exe, which shows that StaticPHP is not only suitable for building static PHP, but also for other projects. Just like we already support building pkg-config and re2c. Making them targets simply makes reasonable.
|
…ith different pkg_root_path set
…fined behaviour sanitizer)
Okay, added curl.exe on Windows too. Also figured out the root cause of the BUILD_CC patch minilua crash (zigs undefined behaviour sanitizer tripping up, if you run |
|
Oh, there's even an issue running the binaries despite no undefined sanitizer that I can't reproduce locally or in docker. Very weird. |
Yup. I have no idea except using native compiler instead. |
|
Hmm, the iconv fail on windows should be unrelated to my changes. |
| { | ||
| // get other things | ||
| $result = self::execWithResult("pkg-config --static --cflags-only-other {$pkg_config_str}"); | ||
| $result = self::execWithResult("pkg-config --static --cflags {$pkg_config_str}"); |
There was a problem hiding this comment.
Do we really need --cflags here? Output may be redundant.
There was a problem hiding this comment.
Imagemagick failed because it was missing -I... paths.
There was a problem hiding this comment.
Not sure if this behavior is safe and not tested here, but I'd rather fix ImageMagick than change the entire pkgconfig for a single library.
…rom cgo includes, even if they're updated)
| { | ||
| // get other things | ||
| $result = self::execWithResult("pkg-config --static --cflags-only-other {$pkg_config_str}"); | ||
| $result = self::execWithResult("pkg-config --static --cflags {$pkg_config_str}"); |
There was a problem hiding this comment.
Not sure if this behavior is safe and not tested here, but I'd rather fix ImageMagick than change the entire pkgconfig for a single library.
| public function fixClangRuntimeBits(): bool | ||
| { | ||
| $installer = new PackageInstaller(interactive: false); | ||
| $installer->addInstallPackage('clang-runtime-bits'); |
There was a problem hiding this comment.
we should probably find a better name for this then 😆
There was a problem hiding this comment.
Any better suggestions? 🧐
There was a problem hiding this comment.
compiler-rtCrtObjects?
There was a problem hiding this comment.
Camel case looks weird here. And zig-compiler-rt ?
There was a problem hiding this comment.
it's not full compiler-rt, only the crt start and end objects.
compiler-rt-crt-objects?
There was a problem hiding this comment.
We might also add llvm-objcopy because gnu objcopy is too dumb to work on other arch binaries.
There was a problem hiding this comment.
Then I think we download full compiler rt anyway, just compiler-rt or llvm-compiler-rt is acceptable.
There was a problem hiding this comment.
From compiler-rt we only need the crt objects and the profiling runtime library. llvm-objcopy is from llvm-binutils. Different download.
Or we download full prebuilt llvm-toolchain. It has everything we need but it's a 2gb download instead of 200kb+2 min build time.
There was a problem hiding this comment.
Edit: downloading compiler-rt is not a good idea because we'd need to download 2gb per target platform, so at least 2x. For llvm-objcopy we could download, but I feel like 2 minutes of build time are preferable to a 2gb download.
What does this PR do?
Checklist before merging
*.phpor*.json, run them locally to ensure your changes are valid:composer cs-fixcomposer analysecomposer testbin/spc dev:sort-configsrc/globals/test-extensions.php.extension testortest extensionsto trigger full test suite.